package com.waya.arraylist;

import java.util.ArrayList;

public class ArrayListDemo3 {
    public static void main(String[] args) {
        ArrayList<Student> students = new ArrayList<>();
        Student student = new Student("wangyang",21);
        Student student1 = new Student("rose",99);
        Student student2 = new Student("joke",34);
        students.add(student);
        students.add(student1);
        students.add(student2);
        for (int i = 0; i < students.size(); i++) {
            Student student3 = students.get(i);
            System.out.println(student3.getName()+  student3.getAge());

        }
    }
}
